home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-02-16 | 1.5 KB | 46 lines | [TEXT/ToyS] |
- property dNames : ["Add…", "Add…", "Add…", "Add…", "Add…", "Add…", "Add…", "Add…", "Add…", "Add…", "Add…", "Add…"]
- property dDocs : [null, null, null, null, null, null, null, null, null, null, null, null]
- property dBounds : [40, 40, 445, 108]
-
- on run
- dd install with fonts {name:"Helvetica", size:9} float above every application
- --if dBounds = null then set dBounds to dd calc dialog bounds [405, 68]
- dd make dialog {bounds:dBounds, default item:0, contents:[¬
- b(1), b(2), b(3), b(4), b(5), b(6), ¬
- b(7), b(8), b(9), b(10), b(11), b(12) ¬
- ], style:sideways palette, name:"Documents", closeable:true}
- repeat
- try
- if DoAction(dd interact with user) then exit repeat
- on error number err
- dd set bounds of dialog 1 to dBounds
- if err ≠ -128 then exit repeat
- end try
- end repeat
- set dBounds to dd get bounds of dialog 1
- dd uninstall
- end run
-
- on b(i)
- set x to 5 + ((i - 1) mod 4) * 100
- set y to 5 + ((i - 1) div 4) * 21
- return {class:push button, bounds:[x, y, x + 95, y + 16], name:item i of dNames}
- end b
-
- on DoAction(i)
- if i = -1 then return true
- if item i of dDocs = null then
- activate
- set dBounds to dd get bounds of dialog 1
- dd set bounds of dialog 1 to [0, -900, 405, -872]
- set doc to choose file with prompt "Select a document:"
- dd set bounds of dialog 1 to dBounds
- set n to (info for doc)'s name
- dd set name of item i of dialog 1 to n
- set item i of dNames to n
- set item i of dDocs to doc
- else
- tell application "Finder" to open item i of dDocs
- end if
- return false
- end DoAction